#include <stdio.h>
#include <unistd.h>
#include <sys/types.h>


int main()
{
  //fork();
  //printf("This is a process, PID is %d, PPID is %d\n",getpid(),getppid());
  //sleep(2);
  
  pid_t id = fork();
  if (id == 0)
  {
    while(1)
    {
      printf("Child process, PID = %d, PPID = %d, id = %d\n",getpid(),getppid(),id);
      sleep(1);
    }
  }
  else if (id > 0)
  {
    while(1)
    {
      printf("Parent process, PID = %d, PPID = %d, id = %d\n",getpid(),getppid(),id);
      sleep(1);
    }
  }

  else
  {
    printf("None.\n");
  }

//  while(1)
//  {
//  printf("This is a process, PID is %d, PPID is %d\n",getpid(),getppid());
//  sleep(1);
//  }
//  return 0;
}
